<!doctype html>
<%@page contentType="text/html;charset=UTF-8"%>
<jsp:directive.page import="com.cn.ccp.bean.UserBean" />
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
<html>
<f:view>
<f:loadBundle var="messages" basename="messages"></f:loadBundle>
<head>
<meta charset="utf-8">
<title><h:outputText value="#{messages['system_title']}" /></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- styles -->
    <link href="<%=request.getContextPath()%>/css/bootstrap.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/css/bootstrap-responsive.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/css/custom.css" rel="stylesheet">
    <!--[if lt IE 9]>
      <script src="<%=request.getContextPath()%>/js/html5.js"></script>
    <![endif]-->
    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%=request.getContextPath()%>/images/icon/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%=request.getContextPath()%>/images/icon/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<%=request.getContextPath()%>/images/icon/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="<%=request.getContextPath()%>/images/icon/apple-touch-icon-57-precomposed.png">
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/images/icon/favicon.png">
</head>

<body class="bg-white" style="overflow-x:hidden;">
<a id="viewDiv"></a>
	<h:form>
		<div class="row page-head">
			<h3 class="page-title">
				<i class="n-icon-selection  n-icon-black"></i>
				<h:outputText value="#{messages['training_page_title']}"/>
				&nbsp;&gt;&nbsp;<b>
				<h:outputText value="#{messages['training_page_training_btn']}" />
				<small>
				<h:outputFormat value="#{messages['course_page_course_title_scorse_info']}" > 
					<f:param value="#{courseTrainingAction.traningTotalScore}"/> 
					<f:param value="#{courseTrainingAction.traningCurrTotalScore}"/> 
				</h:outputFormat>
				</small>
				</b>
			</h3>
		</div>
		<div style="margin-left: 20px;margin-right: 20px">
			<h:commandButton id="showAddButtonid" value="#{messages['training_page_add']}" styleClass="btn btn-primary" action="#{courseTrainingAction.goAddTraining}" disabled="#{courseTrainingAction.showAddButton}"></h:commandButton>
			<h:commandButton value="#{messages['btn_back']}" styleClass="btn btn-primary" action="#{courseTrainingAction.trainingGoBack}"></h:commandButton>
			<div class="table-white">
				<h:dataTable id="listtableinfo"
					value="#{courseTrainingAction.trainingList}" var="cour" cellpadding="2"
					cellspacing="1" styleClass="table table-hover" >
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{messages['training_page_no']}"></h:outputText>
						</f:facet>
						<h:outputText value="#{cour.training_no}"></h:outputText>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{messages['training_page_contents']}"></h:outputText>
						</f:facet>
						<h:outputText value="#{cour.training_contents}"></h:outputText>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{messages['training_page_score']}"></h:outputText>
						</f:facet>
						<h:outputText value="#{cour.training_score}"></h:outputText>
					</h:column>
					
					<h:column>
						<f:facet name="header">
							<h:outputText value=""></h:outputText>
						</f:facet>
						<h:commandLink action="#{courseTrainingAction.goUpdateTraining}" styleClass="text-info">
							<h:outputText value="#{messages['btn_edit']}"></h:outputText>
							<f:param name="id" value="#{cour.id}" />
						</h:commandLink>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value=""></h:outputText>
						</f:facet>
						<a4j:commandLink action="#{courseTrainingAction.goDeleteTraining}"
							reRender="listtableinfo,showAddButtonid" styleClass="text-error"
							onclick="if(!confirm('#{messages['label_delete_sure']}？')){return false;}">
							<h:outputText value="#{messages['btn_delete']}"></h:outputText>
							<f:param name="id" value="#{cour.id}" />
						</a4j:commandLink>
					</h:column>
					
					<h:column>
						<f:facet name="header">
							<h:outputText value=""></h:outputText>
						</f:facet>
						<a4j:commandLink action="#{courseTrainingAction.goUp}"
							reRender="listtableinfo" styleClass="icon-arrow-up">
							<f:param name="id" value="#{cour.id}" />
						</a4j:commandLink>
					</h:column>
					
					<h:column>
						<f:facet name="header">
							<h:outputText value=""></h:outputText>
						</f:facet>
						<a4j:commandLink action="#{courseTrainingAction.goDown}"
							reRender="listtableinfo" styleClass="icon-arrow-down">
							<f:param name="id" value="#{cour.id}" />
						</a4j:commandLink>
					</h:column>
				</h:dataTable>
			</div>
		</div>
	</h:form>
	<script src="<%=request.getContextPath()%>/js/jquery-1.8.3.min.js"></script>
	<script src="<%=request.getContextPath()%>/js/bootstrap.js"></script>
	<script type="text/javascript">
	$(document).ready(function() {
		//document.getElementById('viewDiv').scrollIntoView();
	});</script>
</body>
</f:view>
</html>
